package com.iotechn.unimall.admin.api.association;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.AssociationDO;
import com.iotechn.unimall.data.dto.AssociationDTO;
import com.iotechn.unimall.data.vo.AssociationDetailVO;
import com.iotechn.unimall.data.vo.SelectVO;
import com.iotechn.unimall.data.vo.AssociationVO;
import com.iotechn.unimall.data.vo.UserVO;

import java.util.List;


@HttpOpenApi(group = "admin.association", description = "协会管理服务")
public interface AssociationService {
    @HttpMethod(description = "查询Page", permission = "admin:Association:page", permissionParentName = "协会列表", permissionName = "协会管理")
    public Page<AssociationVO> page(
            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "协会名称") String name,
            @HttpParam(name = "code", type = HttpParamType.COMMON, description = "协会编号") Integer code,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "添加", permission = "admin:Association:create", permissionParentName = "协会列表", permissionName = "协会管理")
    public String create(
            @NotNull @HttpParam(name = "associationDTO", type = HttpParamType.COMMON, description = "JSON传输对象") AssociationDTO associationDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "admin:Association:update", permissionParentName = "协会列表", permissionName = "协会管理")
    public String update(
            @NotNull @HttpParam(name = "associationDTO", type = HttpParamType.COMMON, description = "JSON传输对象") AssociationDTO associationDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "admin:Association:delete", permissionParentName = "协会列表", permissionName = "协会管理")
    public String delete(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "协会id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "批量删除", permission = "admin:Association:batchDelete", permissionParentName = "协会列表", permissionName = "协会管理")
    public String batchDelete(
            @HttpParam(name = "ids", type = HttpParamType.COMMON, description = "协会ids") List ids,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "富文本", permission = "admin:Association:richText", permissionParentName = "协会列表", permissionName = "协会管理")
    public String richText(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "协会id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情(成员)", permission = "admin:Association:detail", permissionParentName = "协会列表", permissionName = "协会管理")
    public List<UserVO> detail(
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "协会id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "协会下拉", permission = "admin:Association:associationSelect", permissionParentName = "协会列表", permissionName = "协会管理")
    public List<SelectVO> associationSelect(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除人员", permission = "admin:Association:deleteUser", permissionParentName = "协会列表", permissionName = "协会管理")
     public String deleteUser(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.COMMON, description = "用户id") Long userId,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
    ) throws ServiceException;

    @HttpMethod(description = "查询协会", permission = "admin:Association:queryAssociation", permissionParentName = "协会列表", permissionName = "协会管理")
    public AssociationDO queryAssociation(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "协会id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId
    ) throws ServiceException;


}
